package xyz.xmh.pojo.response.file;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.PropertyNamingStrategies;
import com.fasterxml.jackson.databind.annotation.JsonNaming;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.net.URL;
import java.util.List;

/**
 * 2021/10/20 5:48 星期三<br/>
 *
 * @author xuMingHai
 */
@EqualsAndHashCode(callSuper = true)
@Data
@JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class)
@JsonInclude(JsonInclude.Include.NON_NULL)
public class CreateFileResponse extends CreateFolderResponse {

    /**
     * 上传ID
     */
    private String uploadId;

    /**
     * 是否快传
     */
    private boolean rapidUpload;

    /**
     * 位置
     */
    private String location;

    private List<PartInfo> partInfoList;


    @Data
    @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class)
    @JsonInclude(JsonInclude.Include.NON_NULL)
    public static class PartInfo {
        private int partNumber;
        /**
         * 上传ID
         */
        private URL uploadUrl;
        private URL internalUploadUrl;
        private String contentType;
    }
}
